Skip to content

refactor: MemberCategory 변환 및 Member 도메인 검증 로직 분리(#25)#26

Merged
chaiminwoo0223 merged 1 commit intodevelopfrom
refactor/25
Jul 13, 2025
Merged

refactor: MemberCategory 변환 및 Member 도메인 검증 로직 분리(#25)#26
chaiminwoo0223 merged 1 commit intodevelopfrom
refactor/25

Conversation

@chaiminwoo0223
Copy link
Contributor

@chaiminwoo0223 chaiminwoo0223 commented Jul 13, 2025

📌 작업 내용 및 특이사항

  • MemberService 내부 로직을 정리하고, 역할 분리를 통해 응집도 향상
  • MemberCategory에 문자열 입력을 안전하게 변환하는 from 정적 메서드 구현
  • MemberPolicy를 도입하여 신규 멤버 유효성 검증 로직 분리
  • MemberErrorCodeINVALID_MEMBER_CATEGORY 메시지 추가
  • 패키지 구조 변경: member.domain.entitymember.domain.model
  • MemberServiceTestshouldThrowExceptionWhenCategoryIsInvalid 메서드 삭제
  • MemberServiceTestshouldThrowExceptionWhenCategoryIsBlank 메서드 추가

🌱 관련 이슈


🔍 참고사항(선택)


📚 기타(선택)

* refactor: MemberService에서 parseCategory, validateMemberNickname, validateNewMember 메서드 삭제
* refactor: MemberCategory에 from 정적 팩토리 메서드 구현
* refactor: member.domain.entity 패키지 -> model.domain.model 패키지 이름 변경

* feat: MemberPolicy 구현
* feat: MemberRepository에 existsBySocialProviderAndSocialId 메서드 구현
* feat: MemberErrorCode에 INVALID_MEMBER_CATEGORY 에러 메시지 추가

* test: shouldThrowExceptionWhenCategoryIsBlank 메서드 추가
@chaiminwoo0223 chaiminwoo0223 requested a review from hisonghy July 13, 2025 04:39
@chaiminwoo0223 chaiminwoo0223 self-assigned this Jul 13, 2025
@chaiminwoo0223 chaiminwoo0223 added the 🪄refactor 기능 개선 및 리팩토링 label Jul 13, 2025
Copy link
Contributor

@hisonghy hisonghy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

도메인 정책을 domain.policy 클래스로 분리해 검증을 수행하고, 멤버 카테고리 변환 로직을 도메인 enum 모델 클래스 내부에 구성하면서 도메인 중심의 객체 책임과 역할이 명확해지고 응집도가 더욱 높아진 것 같아요.
고생하셨습니다 머지 부탁드려요

@chaiminwoo0223 chaiminwoo0223 merged commit e1a12e7 into develop Jul 13, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🪄refactor 기능 개선 및 리팩토링

Projects

None yet

Development

Successfully merging this pull request may close these issues.

🪄[REFACTOR]: MemberCategory 변환 및 Member 도메인 검증 로직 분리

2 participants